#ifndef __MY_EMS_POWER_H__
#define __MY_EMS_POWER_H__

#include "n32l40x.h"
#include "my_gpio.h"

#define EMS_OUTPUT_CTRL_PORT    GPIOD
#define EMS_OUTPUT_CTRL_PIN     GPIO_PIN_14

#define EMS_OUTPUT_ENABLE()     set_pin_high(EMS_OUTPUT_CTRL_PORT, EMS_OUTPUT_CTRL_PIN)
#define EMS_OUTPUT_DISABLE()    set_pin_low(EMS_OUTPUT_CTRL_PORT, EMS_OUTPUT_CTRL_PIN)

#define EMS_POWER_CTRL_PORT     GPIOB
#define EMS_POWER_CTRL_PIN      GPIO_PIN_14
#define EMS_POWER_ON()          set_pin_high(EMS_POWER_CTRL_PORT, EMS_POWER_CTRL_PIN)
#define EMS_POWER_OFF()         set_pin_low(EMS_POWER_CTRL_PORT, EMS_POWER_CTRL_PIN)


void ems_output_enable(void);
void ems_output_disable(void);
void ems_power_on(void);
void ems_power_off(void);

void my_ems_power_init(void);

#endif
